From: Jan Tojnar Date: Sat, 26 Mar 2022 09:50:45 +0000 (+0100) Subject: tests/test-cli-extensions: Fix with single-binary coreutils X-Git-Tag: archive/raspbian/2022.4-1+rpi1^2~9^2~1^2~10^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=1898019face400b84b504c199a5a3de27969103d;p=ostree.git tests/test-cli-extensions: Fix with single-binary coreutils On systems where `coreutils` are built with `--enable-single-binary=symlinks` like Nix, `/usr/bin/env` is symlinked to `/usr/bin/coreutils` and uses `argv[0]` to determine which program to run. Since the `test-cli-extensions.sh` created a new symlink named `ostree-env`, coreutils would be confused about the utility to choose, so running it would fail: ostree-env: unknown program ‘ostree-env’ Try 'ostree-env --help' for more information. Fixes: https://github.com/ostreedev/ostree/issues/2553 --- diff --git a/tests/test-cli-extensions.sh b/tests/test-cli-extensions.sh index e1916036..edce0c9d 100755 --- a/tests/test-cli-extensions.sh +++ b/tests/test-cli-extensions.sh @@ -15,7 +15,9 @@ echo '1..2' mkdir -p ./localbin ORIG_PATH="${PATH}" export PATH="./localbin/:${PATH}" -ln -s /usr/bin/env ./localbin/ostree-env +echo '#!/bin/sh' >> ./localbin/ostree-env +echo 'env "$@"' >> ./localbin/ostree-env +chmod +x ./localbin/ostree-env export A_CUSTOM_TEST_FLAG="myvalue" ${CMD_PREFIX} ostree env >out.txt assert_file_has_content out.txt "^A_CUSTOM_TEST_FLAG=myvalue"